import {State, Repository, Action, Getter, Mutation} from "modules/store-class";
import Base from "./Base";

@Repository
export default class Global extends Base {
  // 弹窗
  @State({
    default: {
      content: "", title: "", show: false, buttons: [],
      callBack: () => {/*null*/},
    },
    set: true,
  })
  public dialog: any;

  // snackBar
  @State({
    default: {
      content: "",
      show: false,
    },
    set: true,
  })
  public snackBar: any;

  // token
  @State({
    default: "",
    set: true,
  })
  public token: any;

  // 裁剪
  @State({
    default: {
      src: "",
      option: { width: 1, height: 1},
      show: false,
      callBack: () => {/**/},
    },
    set: true,
  })
  public cropper: object;
  // 选择图片
  @State({
    default: {
      ratio: [],
      img: "",
      show: false,
      callBack: () => {/**/},
    },
    set: true,
  })
  public selectPhotoType: object;
  // 分享弹窗
  @State({
    default: {
      show: false,
      callBack: () => {/**/},
    },
    set: true,
  })
  public sharePop: object;

  // 支付弹窗
  @State({
    default: {
      show: false,
      callBack: () => {/**/},
    },
    set: true,
  })
  public payPop: object;

  // loading弹窗
  @State({
    default: {
      show: false,
    },
    set: true,
  })
  public loading: object;
}
